GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / SearchTextRegex Method / SearchTextRegex(String,Int32,Boolean,Boolean,IEnumerable<RectangleF>) Method
The regular expression pattern to search for.
The occurrence (rank) of the searched expression on the current page. Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.

Rank equal to 0 is not accepted, it will always be converted to 1. Please note that the occurrence (rank) is always related to the current page.

Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
Set this parameter to true to return the bounding box of only the exact matched text span (e.g., substring/character-level), without expanding to the surrounding word.
Output parameter. If the searched expression has been found, this parameter will output an IEnumerable of rectangle areas that surround the occurrence in inches.





In This Topic
SearchTextRegex(String,Int32,Boolean,Boolean,IEnumerable<RectangleF>) Method
In This Topic
Searches for an occurrence of a given regular expression pattern within the current page of the loaded PDF document according to the parameters you have specified. This method returns bounding box surrounding the searched expression or set of bounding boxes in case the searched expression spans across multiple lines, defined by its top left coordinates and by its width and height in inches, if the expression has been found.
Syntax
'Declaration
 
Public Overloads Function SearchTextRegex( _
   ByVal Pattern As String, _
   ByVal Occurrence As Integer, _
   ByVal CaseSensitive As Boolean, _
   ByVal MatchOnlyBoundingBoxes As Boolean, _
   ByRef BoundingBoxes As IEnumerable(Of RectangleF) _
) As Boolean
public bool SearchTextRegex( 
   string Pattern,
   int Occurrence,
   bool CaseSensitive,
   bool MatchOnlyBoundingBoxes,
   out IEnumerable<RectangleF> BoundingBoxes
)
public function SearchTextRegex( 
    Pattern: String;
    Occurrence: Integer;
    CaseSensitive: Boolean;
    MatchOnlyBoundingBoxes: Boolean;
   Out  BoundingBoxes: IEnumerable
): Boolean; 
public function SearchTextRegex( 
   Pattern : String,
   Occurrence : int,
   CaseSensitive : boolean,
   MatchOnlyBoundingBoxes : boolean,
   BoundingBoxes : IEnumerable
) : boolean;
public: bool SearchTextRegex( 
   string* Pattern,
   int Occurrence,
   bool CaseSensitive,
   bool MatchOnlyBoundingBoxes,
   [PARAMFLAG::Out] IEnumerable<RectangleF>* BoundingBoxes
) 
public:
bool SearchTextRegex( 
   String^ Pattern,
   int Occurrence,
   bool CaseSensitive,
   bool MatchOnlyBoundingBoxes,
   [Out] IEnumerable<RectangleF>^ BoundingBoxes
) 

Parameters

Pattern
The regular expression pattern to search for.
Occurrence
The occurrence (rank) of the searched expression on the current page. Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.

Rank equal to 0 is not accepted, it will always be converted to 1. Please note that the occurrence (rank) is always related to the current page.

CaseSensitive
Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
MatchOnlyBoundingBoxes
Set this parameter to true to return the bounding box of only the exact matched text span (e.g., substring/character-level), without expanding to the surrounding word.
BoundingBoxes
Output parameter. If the searched expression has been found, this parameter will output an IEnumerable of rectangle areas that surround the occurrence in inches.

Return Value

true if the given text expression has been found on the current page according to the specified parameters, otherwise false. The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
Remarks
This method is only allowed for use with non-encrypted documents.

It is recommend to use the GdPicturePDF.GetStat method to identify the specific reason for the method's failure, if any.

See Also